<template>
  <div class="wrap headerwrap">
    <!-- 左侧logo -->
    <div class="logo">
      <img src="@/assets/img/indexLogo.6f8ac4f0.png" alt="" />
    </div>
    <!-- 导航 -->
    <ul class="navs">
      <li @click="fn('/')" :class="{ gaoliang: user === '/' }">首页</li>
      <li :class="{ gaoliang: user === '/goods' }" @click="fn('/goods')">
        全部商品
      </li>
      <li :class="{ gaoliang: user === '/user' }" @click="fn('/user')">
        个人中心
      </li>
      <li :class="{ gaoliang: user === '/order' }" @click="fn('/order')">
        我的订单
      </li>
      <li :class="{ gaoliang: user === '/free' }" @click="fn('/free')">
        专属福利
      </li>
    </ul>
    <!-- 搜索 -->
    <div class="search">
      <input type="text" />
      <span>
        <img src="@/assets/img/search.png" alt="" />
      </span>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      user: "/",
    };
  },
  methods: {
    fn(path) {
      this.$router.push(path);
      this.user = path;
    },
  },
};
</script>

<style lang="less" scoped>
.headerwrap {
  height: 118px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .navs {
    display: flex;
    justify-content: space-between;
    width: 500px;
    height: 16px;
    font-size: 16px;
    font-family: SourceHanSansSC;
    font-weight: 500;
    color: #242b39;
    line-height: 23px;
    .gaoliang {
      color: #0a328e;
      font-weight: 700;
    }
  }
  .search {
    display: flex;
    input {
      width: 214px;
      height: 40px;
      border: 1px solid #dedede;
      border-radius: 20px 0px 0px 20px;
      box-sizing: border-box;
      outline: none;
      text-indent: 1em;
    }
    span {
      width: 50px;
      height: 40px;
      background: #0a328e;
      border-radius: 0px 20px 20px 0px;
      text-align: center;
      line-height: 40px;
    }
  }
}
</style>